import React from 'react';
import { Button, WhiteSpace, WingBlank } from 'antd-mobile';
import { connect } from 'dva';
import Container from '../components/Base/Container';

class CouponPage extends React.Component {
  componentDidMount() {
    window.scrollTo(0, 0);
  }

  render() {
    return (
      <Container title="电子优惠券">
        <div
          style={{
            textAlign: 'center',
            height: '100%',
            lineHeight: '100%',
            paddingTop: '45%',
          }}
        >
          <WingBlank>
            <Button
              onClick={() => this.props.toUsePage()}
            >核销</Button>
          </WingBlank>

          {/* <WhiteSpace size="xl" />
          <WhiteSpace size="xl" />
          <WhiteSpace size="xl" />

          <WingBlank>
            <Button
              onClick={() => this.props.toUsePage()}
            >发券记录</Button>
          </WingBlank> */}

        </div>
      </Container>
    );
  }
}

export default connect((state) => {
  return {};
}, (dispatch, props) => {
  return {
    toUsePage: () => {
      dispatch({
        type: 'coupon/toUsePage',
        payload: {},
      });
    },
    toHistoryPage: () => {
      dispatch({
        type: 'coupon/toHistoryPage',
        payload: {},
      });
    },
  };
})(CouponPage);
